<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>

<head>
<base href="/">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<title>价格等级添加</title>
<meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
<meta name="description"
	content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

<link rel="shortcut icon" href="favicon.ico">
<link href="static/templet/css/bootstrap.min.css?v=3.3.5"
	rel="stylesheet">
<link href="static/templet/css/font-awesome.min93e3.css?v=4.4.0"
	rel="stylesheet">
<link href="static/templet/css/plugins/iCheck/custom.css"
	rel="stylesheet">
<link href="static/templet/css/animate.min.css" rel="stylesheet">
<link href="static/templet/css/style.min862f.css?v=4.1.0"
	rel="stylesheet">

</head>

<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">

		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<div class="form-horizontal">
						   <form method="post" id="keyWordForm" action="keyWord/revision/${msg }" class="form-horizontal" target="_self">
						    <input type="hidden" name="id" value="${info.id }">
							<input type="hidden" name="pageNum" value="${param.pageNum }"/>
							<div class="form-group">
								<label class="col-sm-4 control-label">业务类型</label>
								<div class="col-sm-6">
									<c:if test="${info.service_type == '01'}">
										<input type="text" value="优化" readonly="readonly" class="form-control">
									</c:if>
									<c:if test="${info.service_type == '02'}">
										<input type="text" value="新站" readonly="readonly" class="form-control">
									</c:if>
									<c:if test="${info.service_type == '03'}">
										<input type="text" value="整站" readonly="readonly" class="form-control">
									</c:if>
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-4 control-label">用户类型</label>

								<div class="col-sm-6">
									<c:if test="${info.user_type == '01'}">
										<input type="text" value="普通用户" readonly="readonly" class="form-control">
									</c:if>
									<c:if test="${info.user_type == '02'}">
										<input type="text" value="代理用户" readonly="readonly" class="form-control">
									</c:if>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-4 control-label">vip等级</label>

								<div class="col-sm-6">
									<input type="text" value="${info.vip_level }" readonly="readonly" class="form-control">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-4 control-label">初始价格</label>

								<div class="col-sm-6">
									<input type="number" min="0" id="init_price" name="init_price" value="${info.init_price }"
										class="form-control">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-4 control-label">递增指数</label>

								<div class="col-sm-6">
									<input type="number" min="0" id="add_index" name="add_index" value="${info.add_index }"
										class="form-control">
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-4 control-label">递增价格</label>

								<div class="col-sm-6">
									<input type="number" min="0" id="add_price" name="add_price" value="${info.add_price }"
										class="form-control">
								</div>
							</div>
							
							<div class="hr-line-dashed"></div>
							<div class="form-group">
								<div class="col-sm-4 col-sm-offset-4">
									<button class="btn btn-primary" onclick="save()" type="button">保存</button>
									<button class="btn btn-white" onclick="cancel()" type="button">取消</button>
								</div>
							</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<script src="static/templet/js/jquery.min.js?v=2.1.4"></script>
	<script src="static/templet/js/bootstrap.min.js?v=3.3.5"></script>
	<script src="static/templet/js/content.min.js?v=1.0.0"></script>
	<script src="static/templet/js/iframe.min.js"></script>
	<script src="static/templet/js/plugins/layer/layer.min.js"></script>
	<script src="static/templet/js/plugins/iCheck/icheck.min.js"></script>
	<script src="static/templet/js/plugins/layer/laydate/laydate.js"></script>
	<script type="text/javascript">
	
	$(function(){
		var message = '${param.message1}';
		if(message != null && message != "") {
			parent.layer.msg(message, {icon: 2});
		}
	})
	
	
		function cancel() {
			iframe.close(0);
		}

		function save() {
			
			var service_type = $('#service_type option:selected').val();
			var user_type = $('#user_type option:selected').val();
			var vip_level = $('#vip_level option:selected').val();
			
			
			var load = layer.load(1, {
				shade : [ 0.1, '#fff' ]
			});
			var init_price = $.trim($("#init_price").val());
			if (init_price == '') {
				layer.msg('请输入初始价格', {
					icon : 1
				});
				layer.close(load);
				return;
			}
			var add_index = $.trim($("#add_index").val());
			if (add_index == '') {
				layer.msg('请输入递增指数', {
					icon : 1
				});
				layer.close(load);
				return;
			}
			var add_price = $.trim($("#add_price").val());
			if (add_price == '') {
				layer.msg('请输入递增价格', {
					icon : 1
				});
				layer.close(load);
				return;
			}
			
			keyWordForm.submit();

			/* $.post('keyWord/revision/saveVipLevel', {
				service_type : service_type,
				user_type : user_type,
				vip_level : vip_level,
				init_price : init_price,
				add_index : add_index,
				add_price : add_price
			}, function(data, status) {
				if (status == 'success') {
					var result = data.result;
					var state = result.state;
					layer.close(load);
					if (state == 1) {
						layer.msg('保存成功', {
							icon : 1
						});
						iframe.close(1);
					} else {
						layer.msg(result.message, {
							icon : 1
						});
					}
				}
			}) */
		}
	</script>
</body>

</html>